package com.examplemartin.jpademo.dao;

import com.examplemartin.jpademo.pojo.po.cust.CustPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CustDao extends JpaRepository<CustPO,Long>, JpaSpecificationExecutor<CustPO> {

    // 添加顾客 验证(按名称,地址select) 有记录代表重复
    List<CustPO> findAllByNameAndAddress(String name,String address);

    // 按状态查找
    List<CustPO> findAllByStatus(Integer status);
}
